<?php
ob_start();
include 'connect/connect.php';
check_admin();
if ($_POST['user']==''  and $_POST['pass'] == '' and $_POST['tdl'] == '')
{
echo '<form method="POST" action="#">
	<p align="left"></p>
	<p align="left">User:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="text" name="user" size="20"></p>
	<p align="left">Password: <input type="password" name="pass" size="20"></p>
	<p align="left">Tên đại lý <input type="text" name="tdl" size="20"></p>
	<p align="left">Mail <input type="text" name="mail" size="20"></p>
	<p align="left">SĐT <input type="text" name="sdt" size="20"></p>
	<p align="left">Địa chỉ <input type="text" name="diachi" size="20"></p>
	<p align="left"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>';
}
else
{
	$user = $_POST['user'];
	$pass = $_POST['pass'];
	$tdl = $_POST['tdl'];
	$mail = $_POST['mail'];
	$diachi = $_POST['diachi'];
	$sdt = $_POST['sdt'];
	$sql = mysql_query("INSERT INTO user(user,pass,tdl,sdt,diachi,mail) VALUES ('$user','$pass','$tdl','$sdt','$diachi','$mail')");
		if($sql)
		{
			echo 'Ok';
		}
}
?>